package it.uniroma2.art.coda.pearl.model;

import it.uniroma2.art.coda.pearl.model.graph.GraphSingleElement;

/**
 * This class represent the graph element (the triple, not the single element inside it)
 * 
 * @author Andrea Turbati
 * 
 */
public class GraphStruct extends GraphElement {

	private GraphSingleElement subject;
	private GraphSingleElement predicate;
	private GraphSingleElement object;
	private ProjectionRule ownerRule;

	public GraphStruct(GraphSingleElement subject, GraphSingleElement predicate, 
			GraphSingleElement object, ProjectionRule ownerRule) {
		initialize(subject, predicate, object, ownerRule);
	}

	private void initialize(GraphSingleElement subject, GraphSingleElement predicate, 
			GraphSingleElement object, ProjectionRule ownerRule) {
		this.subject = subject;
		this.predicate = predicate;
		this.object = object;
		this.ownerRule = ownerRule;
//		if (subj.getPRRule() == pred.getPRRule() && pred.getPRRule() == obj.getPRRule()) {
//			prRule = subj.getPRRule();
//			issueWithPRRule = false;
//		} else {
//			prRule = null;
//			issueWithPRRule = true;
//		}
	}
	
	public GraphSingleElement getSubject() {
		return subject;
	}

	public GraphSingleElement getPredicate() {
		return predicate;
	}

	public GraphSingleElement getObject() {
		return object;
	}

	public ProjectionRule getOwnerRule() {
		return ownerRule;
	}

}
